#pragma once
#include <vector>
#include <tuple>
#include "HSModelAPI.h"
#include "GeometryUtils.h"
#include <functional>
#include "HeightMap.h"

//The Cell is represented by its top-left point
typedef std::pair<size_t, size_t> Cell;

// heights of the cell with the specified order: up_left, up_right, bottom_left, bottom_right 
typedef std::tuple <double, double, double, double> Heights;


HSMODEL_API std::vector<TTriangle3>  PickTrianglesWithCellsAndLine (const HeightMap& i_map, const TLine3& i_line);

HSMODEL_API std::pair<TTriangle3, TTriangle3>  GetTrianglesByCell (const Cell& i_cell, const Heights& i_heights);


//Do not pick cells sometimes if ray2 has only one intersection point with the height map 
HSMODEL_API std::vector<Cell> PickNeededCells (const HeightMap& i_map, const TRay2& i_ray);
